local switchBtn = 4 -- 连点开关-按钮
local clickNum = 1 -- 控制台打印用

OutputLogMessage("分隔------------------------------------------------------分隔\n")
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
    -- OutputLogMessage("Event: " .. event .. " Arg: " .. arg .. "\n")

    if (event == "MOUSE_BUTTON_PRESSED" and arg == switchBtn) then
        -- 开大写锁定，按侧键使用，关大写锁定关闭(参数还没调好)
        while IsKeyLockOn("capslock") do
            -- OutputLogMessage("触发: %s\n", clickNum)
            -- 左键按下
            OutputLogMessage("按下\n")
            PressMouseButton(1)
            -- 左键按下间隔时间
            Sleep(math.random(200, 238))
            -- 左键弹起
            OutputLogMessage("弹起\n")
            ReleaseMouseButton(1)
            -- 两次点击间隔
            Sleep(math.random(150, 180))
            -- OutputLogMessage("结束\n")
            clickNum = clickNum + 1
        end
    end
end
